package com.qfedu.yuxiaoer.mapper;

import com.qfedu.yuxiaoer.dto.House;
import com.qfedu.yuxiaoer.entity.HouseLease;
import com.qfedu.yuxiaoer.entity.HouseLeaseExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HouseLeaseMapper {
    long countByExample(HouseLeaseExample example);

    int deleteByExample(HouseLeaseExample example);

    /**
     * 根据ID删除整租/合租信息
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);


    /**
     * 新增整租/合租
     * @param record
     * @return
     */
    int insert(HouseLease record);

    int insertSelective(HouseLease record);

    List<HouseLease> selectByExample(HouseLeaseExample example);

    /**
     * 根据ID查询整租/合租信息
     * @param id
     * @return
     */
    HouseLease selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") HouseLease record, @Param("example") HouseLeaseExample example);

    int updateByExample(@Param("record") HouseLease record, @Param("example") HouseLeaseExample example);

    int updateByPrimaryKeySelective(HouseLease record);

    int updateByPrimaryKey(HouseLease record);

    /**
     * 根据小区名字查询整租/合租信息 如果为空则为查询所有信息
     * @param community
     * @return
     */
    List<HouseLease> selectByCommunity(String community);

    List<House> selectHouse(String string);


}